home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_87 / strconst.pas < prev    next >
Pascal/Delphi Source File  |  1995-01-01  |  9KB  |  253 lines

  1. {****************************************************************************}
  2. {                                                                            }
  3. { MODULE:         StrConst                                                   }
  4. {                                                                            }
  5. { DESCRIPTION:    Module that provides the constants for the Strings in the  }
  6. {                 VT library, and the routines that export the different     }
  7. {                 strings for the different languages.                       }
  8. {                                                                            }
  9. { AUTHOR:         Juan Carlos Arévalo                                        }
  10. {                                                                            }
  11. { MODIFICATIONS:  Nobody (yet ;-)                                            }
  12. {                                                                            }
  13. { HISTORY:        11-Nov-1992 Documentation                                  }
  14. {                                                                            }
  15. { (C) 1992 VangeliSTeam                                                      }
  16. {____________________________________________________________________________}
  17.  
  18. UNIT StrConst;
  19.  
  20. INTERFACE
  21.  
  22. USES Dos, Objects;
  23.  
  24.  
  25.  
  26.  
  27. CONST
  28.  
  29. { General purpose messages. }
  30.  
  31.   StrInitializing           = $0000;
  32.  
  33. { ModUnit error messages. }
  34.  
  35.   StrFileNotExist           = $0100;
  36.   StrFileTooShort           = $0101;
  37.   StrFileOpenError          = $0102;
  38.   StrOutOfMemory            = $0103;
  39.   StrFileDamaged            = $0104;
  40.   StrFileFormatNotSupported = $0105;
  41.  
  42.   StrFileFormats            = $0150; { 10+ File formats }
  43.  
  44. { Device descriptions. }
  45.  
  46.   StrDevSpkrName            = $0200;
  47.  
  48.   StrDevSBDacName           = $0210;
  49.   StrDevMixSBDacName        = $0211;
  50.   StrDevMix2SBDacName       = $0212;
  51.  
  52.   StrDevSBName              = $0220;
  53.   StrDevDMASBName           = $0221;
  54.   StrDevDMASBSterName       = $0222;
  55.   StrDevDMASBMixName        = $0223;
  56.   StrDevDMASBMix2Name       = $0224;
  57.  
  58.   StrDevDACName             = $0230;
  59.   StrDevDAC2Name            = $0231;
  60.   StrDevMixDAC2Name         = $0232;
  61.   StrDevMix2DAC2Name        = $0233;
  62.  
  63.   StrDevAdLibName           = $0240;
  64.  
  65.   StrDevFileName            = $0250;
  66.  
  67. { Device descriptions. }
  68.  
  69.   StrSwapNotInit            = $0300;
  70.  
  71.  
  72. FUNCTION  InitStrings(f: PathStr) : BOOLEAN; { Initialize the strings file.    }
  73. FUNCTION  GetString  (Key: WORD)  : STRING;  { Used to get the desired string. }
  74.  
  75. PROCEDURE LibAddSpanishMsg(VAR List: TStrListMaker); { Spanish strings. }
  76. PROCEDURE LibAddEnglishMsg(VAR List: TStrListMaker); { English Strings. }
  77.  
  78.  
  79.  
  80.  
  81. IMPLEMENTATION
  82.  
  83.  
  84.  
  85.  
  86. VAR
  87.   Strings: TStringList; { The Turbo Vision string list object.              }
  88.   Stream : TBufStream;  { The file stream where the string list is located. }
  89.  
  90.  
  91.  
  92.  
  93. {----------------------------------------------------------------------------}
  94. { User routines.                                                             }
  95. {____________________________________________________________________________}
  96.  
  97. FUNCTION InitStrings(f: PathStr) : BOOLEAN;
  98.   CONST
  99.     Hdr : ARRAY[0..5] OF CHAR = ( 'V', 'T', ' ', 'L', 'N', 'G' );
  100.   VAR
  101.     s : ARRAY[0..255] OF CHAR;
  102.     h : ARRAY[0..5] OF CHAR ABSOLUTE s;
  103.     i : LONGINT;
  104.   LABEL
  105.     Ya;
  106.   BEGIN
  107.  
  108.     Stream.Init(f, stOpenRead, 1024);
  109.  
  110.     i := Stream.GetSize;
  111.     IF i > 256 THEN i := 256;
  112.     Stream.Read(s, i);
  113.  
  114.     IF h <> Hdr THEN
  115.       BEGIN
  116.         InitStrings := FALSE;
  117.         Stream.Done;
  118.         EXIT;
  119.       END;
  120.  
  121.     FOR i := 0 TO i-1 DO
  122.       IF s[i] = #$1A THEN GOTO Ya;
  123. Ya:
  124.     Stream.Seek(i+1);
  125.     Strings.Load(Stream);
  126.  
  127.     InitStrings := TRUE;
  128.   END;
  129.  
  130.  
  131. FUNCTION  GetString(Key: WORD) : STRING;
  132.   BEGIN
  133.     GetString := Strings.Get(Key);
  134.   END;
  135.  
  136.  
  137.  
  138.  
  139. {----------------------------------------------------------------------------}
  140. { Routines that write the different streams to the list.                     }
  141. {____________________________________________________________________________}
  142.  
  143. PROCEDURE LibAddSpanishMsg(VAR List: TStrListMaker);
  144.   BEGIN
  145.  
  146.     List.Put(StrInitializing           , 'Inicializando ');
  147.  
  148.  
  149.     List.Put(StrFileNotExist           , 'No hubo ninguna canción');
  150.     List.Put(StrFileTooShort           , 'Fin de fichero antes de tiempo');
  151.     List.Put(StrFileOpenError          , 'Error al abrir el fichero');
  152.     List.Put(StrOutOfMemory            , 'No hay memoria');
  153.     List.Put(StrFileDamaged            , 'El fichero no tiene canciones');
  154.     List.Put(StrFileFormatNotSupported , 'Formato no soportado: ');
  155.  
  156.     List.Put(StrFileFormats+0          , 'formato desconocido');
  157.     List.Put(StrFileFormats+1          , 'ProTracker "M.K."');
  158.     List.Put(StrFileFormats+2          , 'ProTracker "FLT4"');
  159.     List.Put(StrFileFormats+3          , 'SoundTracker');
  160.     List.Put(StrFileFormats+4          , 'JMPlayer');
  161.     List.Put(StrFileFormats+5          , 'Oktalizer');
  162.     List.Put(StrFileFormats+6          , 'Composer 669');
  163.     List.Put(StrFileFormats+7          , 'Grave');
  164.     List.Put(StrFileFormats+8          , 'Triton FasTracker');
  165.     List.Put(StrFileFormats+9          , 'Scream Tracker 3.0');
  166.     List.Put(StrFileFormats+10         , 'Scream Tracker 3.0 beta');
  167.     List.Put(StrFileFormats+11         , 'Scream Tracker 2.x');
  168.  
  169.     List.Put(StrDevSpkrName            , 'Altavoz interno del PC');
  170.  
  171.     List.Put(StrDevSbDACName           , 'DAC + SB estéreo');
  172.     List.Put(StrDevMixSbDACName        , 'DAC + SB estéreo (mezcla suave)');
  173.     List.Put(StrDevMix2SbDACName       , 'DAC + SB estéreo (mezcla fuerte)');
  174.  
  175.     List.Put(StrDevSBName              , 'Sound Blaster mono sin DMA');
  176.     List.Put(StrDevDMASBName           , 'Sound Blaster mono con DMA');
  177.     List.Put(StrDevDMASBSterName       , 'SB-Pro estéreo con DMA');
  178.     List.Put(StrDevDMASBMixName        , 'SB-Pro estéreo con DMA (mezcla suave)');
  179.     List.Put(StrDevDMASBMix2Name       , 'SB-Pro estéreo con DMA (mezcla fuerte)');
  180.  
  181.     List.Put(StrDevDACName             , 'DAC mono en LPT1');
  182.     List.Put(StrDevDAC2Name            , 'DAC estéreo en LPT1 - LPT2');
  183.     List.Put(StrDevMixDAC2Name         , 'DAC estéreo en LPT1 - LPT2 (mezcla suave)');
  184.     List.Put(StrDevMix2DAC2Name        , 'DAC estéreo en LPT1 - LPT2 (mezcla fuerte)');
  185.  
  186.     List.Put(StrDevAdLibName           , 'Tarjeta de sonido AdLib o compatible');
  187.  
  188.     List.Put(StrDevFileName            , 'Fichero SBDSP$ (driver OS/2)');
  189.  
  190.  
  191.     List.Put(StrSwapNotInit            , 'Error al inicializar el fichero de swap.');
  192.  
  193.   END;
  194.  
  195.  
  196. PROCEDURE LibAddEnglishMsg(VAR List: TStrListMaker);
  197.   BEGIN
  198.  
  199.     List.Put(StrInitializing           , 'Initializing ');
  200.  
  201.  
  202.     List.Put(StrFileNotExist           , 'Didn''t find any songs');
  203.     List.Put(StrFileTooShort           , 'Unexpected end of file');
  204.     List.Put(StrFileOpenError          , 'File open error');
  205.     List.Put(StrOutOfMemory            , 'Out of memory');
  206.     List.Put(StrFileDamaged            , 'File had no songs');
  207.     List.Put(StrFileFormatNotSupported , 'Unsupported file format: ');
  208.  
  209.     List.Put(StrFileFormats+0          , 'unknown format');
  210.     List.Put(StrFileFormats+1          , 'ProTracker "M.K."');
  211.     List.Put(StrFileFormats+2          , 'ProTracker "FLT4"');
  212.     List.Put(StrFileFormats+3          , 'SoundTracker');
  213.     List.Put(StrFileFormats+4          , 'JMPlayer');
  214.     List.Put(StrFileFormats+5          , 'Oktalizer');
  215.     List.Put(StrFileFormats+6          , 'Composer 669');
  216.     List.Put(StrFileFormats+7          , 'Grave');
  217.     List.Put(StrFileFormats+8          , 'Triton FasTracker');
  218.     List.Put(StrFileFormats+9          , 'Scream Tracker 3.0');
  219.     List.Put(StrFileFormats+10         , 'Scream Tracker 3.0 beta');
  220.     List.Put(StrFileFormats+11         , 'Scream Tracker 2.x');
  221.  
  222.  
  223.     List.Put(StrDevSpkrName            , 'PC Internal Speaker');
  224.  
  225.     List.Put(StrDevSbDACName           , 'DAC + SB stereo');
  226.     List.Put(StrDevMixSbDACName        , 'DAC + SB stereo (mild mix)');
  227.     List.Put(StrDevMix2SbDACName       , 'DAC + SB stereo (tough mix)');
  228.  
  229.     List.Put(StrDevSBName              , 'NON-DMA Sound Blaster');
  230.     List.Put(StrDevDMASBName           , 'DMA Sound Blaster');
  231.     List.Put(StrDevDMASBSterName       , 'DMA Stereo SB-Pro');
  232.     List.Put(StrDevDMASBMixName        , 'DMA Stereo SB-Pro (mild mix)');
  233.     List.Put(StrDevDMASBMix2Name       , 'DMA Stereo SB-Pro (tough mix)');
  234.  
  235.     List.Put(StrDevDACName             , 'mono DAC in LPT1');
  236.     List.Put(StrDevDAC2Name            , 'stereo DAC in LPT1 - LPT2');
  237.     List.Put(StrDevMixDAC2Name         , 'stereo DAC in LPT1 - LPT2 (mild mix)');
  238.     List.Put(StrDevMix2DAC2Name        , 'stereo DAC in LPT1 - LPT2 (tough mix)');
  239.  
  240.     List.Put(StrDevAdLibName           , 'AdLib sound card or compatible');
  241.  
  242.     List.Put(StrDevFileName            , 'SBDSP$ file (OS/2 driver)');
  243.  
  244.  
  245.     List.Put(StrSwapNotInit            , 'Error initializing the swap file.');
  246.  
  247.   END;
  248.  
  249.  
  250.  
  251.  
  252. END.
  253.